<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<!DOCTYPE html>

<html>

<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>用户列表</title>
    <link rel="stylesheet" type="text/css" href="/static/css/main.css">
    <link rel="stylesheet" type="text/css" href="/static/css/homepage.css">
    <link rel="stylesheet" type="text/css" href="/static/css/demo.css">
</head>

<body>
    <div id="indextop" class="header header2 header-theme-none">
        <div class="logo fl">
            <a href="/indexx"></a>
        </div>
        <div class="nav fl">
            <a href="/index">首页</a>
            <a href="/course/stuCourseScore?stuId=${user.id}&page=1">课程成绩</a>
            <a href="/problem/feedback?stuId=${user.id}&page=1">问题反馈</a>
            <c:if test="${user.role.id == 1}">
                <div id="solutiontop" style="float:left;height: 60px;overflow: hidden;">
                    <a target="_blank" style="cursor: pointer;">用户管理</a>
                    <ul id="solutionul">
                        <div style="height:10px;"></div>
                        <li class="solutionli">
                            <a href="/user/findAllUser?page=1">用户列表</a>
                        </li>
                        <li class="solutionli">
                            <a href="/user/addUser">用户增加</a>
                        </li>

                        <div style="height:10px;"></div>
                    </ul>
                </div>
            </c:if>
            <div id="solutiontop" style="float:left;height: 60px;overflow: hidden;">
                <a target="_blank" style="cursor: pointer;">统计信息</a>
                <ul id="solutionul">
                    <div style="height:10px;"></div>
                    <c:if test="${user.role.id == 1}">
                        <li class="solutionli">
                            <a href="/log/getUserStatistics?page=1">访问统计</a>
                        </li>
                        <li class="solutionli">
                            <a href="/log/getAllLog?page=1">用户访问</a>
                        </li>
                    </c:if>
                    <li class="solutionli">
                        <a href="/log/getLog?userId=${user.id}&page=1">个人访问</a>
                    </li>
                    <div style="height:10px;"></div>
                </ul>
            </div>
        </div>
        <style>
            #solutiontop{
                color: #357ae8;
            }
            #solutiontop:hover{
                /* 这里用auto有时无效，如果高度小于元素加起来的高度有bug */
                height: 500px !important;
                color: #357ae8;
            }
            #solutionul{
                overflow: hidden;
                clear: both;
                background: white;
                width: 120px;
                margin: -5px;
                box-shadow: 0px 0px 5px 1px rgba(80,80,80,0.4);
                position: relative;
                z-index: 1;
            }
            .solutionli a{
                width: 100%;
                text-align: center;
                box-sizing: border-box;
                color: #333 !important;
                padding: 0 10px !important;
                height: 40px !important;
                line-height: 40px !important;
            }
            .solutionli{
                height: 40px;
            }
        </style>
        <div class="log-reg fr">
            <a href="#" class="userName" style="">${user.name}</a>
            <a href="/outLogin" class="outLogin">退出登录</a>

        </div>

    </div>

    <div class="home-page">

        <%--<div class="wapper">--%>
        <div class="infoBox">
            <table class="info">
                <caption>个人信息</caption>
                <tr>
                    <td class="td-left" align="right">用户名：</td>
                    <td class="td-right" align="right">${user.userName}</td>
                </tr>
                <tr>
                    <td class="td-left" align="right">邮箱：</td>
                    <td class="td-right" align="right">${user.email}</td>
                </tr>
                <tr>
                    <td class="td-left" align="right">姓名：</td>
                    <td class="td-right" align="right">${user.name}</td>
                </tr>
                <tr>
                    <td class="td-left" align="right">角色：</td>
                    <td class="td-right" align="right">${user.role.name}</td>
                </tr>
            </table>
        </div>

    </div>

    <script type="text/javascript" src="/static/js/jquery-2.1.1.min.js"></script>
    <script type="text/javascript" src="/static/js/main.js"></script>


</body>
</html>